package me.zhengjie.modules.workorder.repository;

import me.zhengjie.modules.workorder.domain.TTasks;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
* @author zcw
* @date 2019-08-10
*/
public interface TTasksRepository extends JpaRepository<TTasks, Long>, JpaSpecificationExecutor {
	
	@Query(value="SELECT * from t_tasks where NOT EXISTS (SELECT 1 from t_work_order where t_tasks.id=t_work_order.source_id)",nativeQuery = true)
	public List<TTasks> findTAccidentWithOrder();
	
}